package com.chennan.spring.demo.annotation.imports;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author chennan
 * @create 2021-11
 */
public class Test2222 {
    public static void main(String[] args) {
        ApplicationContext app = new AnnotationConfigApplicationContext(ConfigurationTestImport.class);
        Object monkey = app.getBean("monkey");
        //org.springframework.beans.factory.BeanFactoryUtils.transformedBeanName
        System.out.println(monkey.getClass());
        Object mou = app.getBean("&monkey");
        System.out.println(mou.getClass());


        String[] beanDefinitionNames = app.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName);
        }
    }
}
